class Solution {
public:
    ListNode* FindKthToTail(ListNode* pHead, int k) {
        ListNode* i = pHead;
        ListNode* j = pHead;
        int cnt = 0;
        ListNode* z = pHead;
        while (z) {
            z = z->next;
            cnt++;
        }
        if (cnt < k)return nullptr;
        while (k-- && i) {
            i = i->next;
        }
        while (i) {
            i = i->next;
            j = j->next;
        }
        return j;
    }
};